import pytest,yamail,time,logging
def wj():
    # t=time.strftime('Y%m%d%M%H%S%',time.localtime())
    logging.basicConfig(filename='hh.log',level=logging.ERROR,filemode='a+',format='%(filename)s--%(asctime)s--%(thread)d--%(message)s ')
def fs(wen):
    a=yamail.SMTP(user='1391277593@qq.com',password='npphtjsegwjqhiae',host='smtp.qq.com')
    a.send(to='1391277593@qq.com',subject='测试报告',contents='请查收',attachments=wen)
if __name__ == '__main__':
    wj()
    pytest.main(['Testjxw.py','','--html=mm.html'])
    fs(['mm.html','hh.log'])